package com.atguigu.springcloud.cloudsentinelgatewaydevelop.service;

import com.atguigu.springcloud.cloudsentinelgatewaydevelop.bean.dto.SentinelFlowRuleDTO;
import org.springframework.web.bind.annotation.RequestBody;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * xx
 *
 * @author BugFree Jin
 * @version 1.0
 * @since 2022/3/2 16:19
 */
public interface FlowRuleService {
    // 增
    Mono<Integer> save(@RequestBody SentinelFlowRuleDTO sentinelFlowRuleDTO);

    // 根据主键id删
    Mono<Integer> deleteById(Long id);

    // 根据applicationName删
    Mono<Integer> deleteByAyApplicationName(String applicationName);

    // 根据id进行更新，无法通过applicationName进行更新，因为暂定其不唯一
    Mono<Integer> updateById(@RequestBody SentinelFlowRuleDTO sentinelFlowRuleDTO, Long id);

    // 根据Id查
    Mono<SentinelFlowRuleDTO> findById(Long id);

    // 根据applicationName查询列表
    Flux<SentinelFlowRuleDTO> findByApplicationName(String applicationName);
}
